#include "../math/vec2d.h"

#ifndef TERRAGE_CAMERA_H_INCLUDED
#define TERRAGE_CAMERA_H_INCLUDED

namespace TerraGE {
    class Camera {
        protected:
            float target_x, target_y;
            float x, y;
            float zoom;

            float map_w, map_h, map_t;

            float projection_factor;
            float height_factor;
        public:
            Camera();
            void Set_X(float v) {x = v;}
            float Get_X() {return x;}

            void Set_Y(float v) {y = v;}
            float Get_Y() {return y;}

            void Set_Target_X(float v) {target_x = v;}
            float Set_Target_X() {return target_x;}

            void Set_Target_Y(float v) {target_y = v;}
            float Set_Target_Y() {return target_y;}

            void Move_Target_X(float v) {target_x += v;}
            void Move_Target_Y(float v) {target_y += v;}

            void Set_Map_Width(float v) {map_w = v;}
            float Get_Map_Width() {return map_w;}

            void Set_Map_Height(float v) {map_h = v;}
            float Get_Map_Height() {return map_h;}

            void Set_Map_Tall(float v) {map_t = v;}
            float Get_Map_Tall() {return map_t;}

            Vec2D Proj_To_Screen(float mx, float my, float z=0);
            Vec2D Screen_To_Proj(float mx, float my, float z=0);

            Vec2D Snap_To_Map(Vec2D pos);

            Vec2D Get_Projection_Offset();

            void Update(float timestep);

            float Get_Projection_Factor() {return projection_factor;}
            float Get_Height_Factor() {return height_factor;}

            float Get_Zoom() {return zoom;}
            void Set_Zoom(float v) {zoom = v;}
    };
}


#endif
